<?php
class Mech_IndexController extends Zend_Controller_Action {
	
	public function init() {
		$this->model = new Mech_Model_Item();
		if ($this->_request->isXmlHttpRequest ()) {
			$this->_helper->layout ()->disableLayout ();
		}
	}
	
	public function listAction(){
		$this->_helper->incLocalRes(array('mech.css','mech.js'));
		$res=$this->model->getList(1,0);
		$this->view->res=$res;
	}
	
	public function itemAction(){
		$alias = $this->_helper->checkParam('alias',true,'StripTags','NotEmpty');
		$item=$this->model->getOne($alias);
		$this->view->item=$item;
	}

}
